#predo="source $myenvsh -n"

#GSI
#predo="source $myenvsh -n"                                                                                                                                                                             

#HD
#predo="source /alidata60/alice_u/lu/workspace/source.sh; cd /alidata60/alice_u/lu/workspace/tcf/; source source.sh; cd -; "

#for kk in $(echo $(pwd)/cmpEta_*{1,2} | tr -s ' ' '\n' | sort -r)
for kk in $(echo $(pwd)/cmpEta_*)
#for kk in $(echo $(pwd)/cmpEta_*8)
do 
    if [ ! -e $kk ]
    then
        continue;
    fi

    touch $kk;  
    cd $kk;

    cp ../alldo.sh .

    cat > subgo.sh <<EOF

uname -a

$predo

cd $kk

echo ls
ls
echo

echo pwd
pwd
echo

export PATH=$(pwd)/:$PATH  

echo go
            
./alldo.sh > seealldo.log
            
EOF

    chmod +x subgo.sh; 

    #qsub -cwd -l h_rt=10:0:0,h_rss=2G  ./subgo.sh
    ./subgo.sh 

    cd -;
done

